import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_ownership_type.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_ownership_type.dart';

abstract class CreateApiAppStoreTransactionOwnershipTypeFromInternalOne {
  ApiAppStoreTransactionOwnershipType call({
    required AppStoreTransactionOwnershipType ownershipType,
  });
}

class CreateApiAppStoreTransactionOwnershipTypeFromInternalOneImpl
    implements CreateApiAppStoreTransactionOwnershipTypeFromInternalOne {
  const CreateApiAppStoreTransactionOwnershipTypeFromInternalOneImpl();

  @override
  ApiAppStoreTransactionOwnershipType call({
    required AppStoreTransactionOwnershipType ownershipType,
  }) {
    switch (ownershipType) {
      case AppStoreTransactionOwnershipType.purchase:
        return ApiAppStoreTransactionOwnershipType.purchase;
      case AppStoreTransactionOwnershipType.familySharing:
        return ApiAppStoreTransactionOwnershipType.familySharing;
    }
  }
}
